<template>
<v-card>
  <v-card-title>
核心总账科目映射
      <v-spacer></v-spacer>
      <v-text-field
        v-model="search"
        append-icon="mdi-magnify"
        label="Search"
        single-line
        hide-details
      ></v-text-field>
  </v-card-title>
  <v-card-text>
  <v-data-table 
  dense 
  :headers="headers"
   :items="desserts"
   :search="search"
   :items-per-page="20"
     class="elevation-1"
     >
    <template v-slot:item.businessCode="{ item }">
      <v-btn text color="blue darken-1" @click="businessInfo(item)">{{item.businessCode}}</v-btn>
    </template>
  </v-data-table>

  
  <v-dialog v-model="dialog" max-width="800px">
    <v-card>
      <v-card-title>
        业务代号详情
      </v-card-title>
      <v-card-text>
         <v-container>
                <v-row>
                  <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.biemng" label="业务代号别名"></v-text-field>
                  </v-col>
                  <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.yewudh" label="业务代号"></v-text-field>
                  </v-col>
                   <v-col cols="12" sm="12" md="12">
                    <v-text-field  outlined dense v-model="business.ywudhm" label="业务代号名"></v-text-field>
                  </v-col>
                </v-row>
                 <v-row>
                  <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.kmuhao" label="科目号"></v-text-field>
                  </v-col>
                  <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.kemucc" label="科目存储"></v-text-field>
                  </v-col>
                   <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.yueexz" label="余额性质"></v-text-field>
                  </v-col>
                </v-row>
                 <v-row>
                  <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.nfkhbz" label="能否联机开户"></v-text-field>
                  </v-col>
                  <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.xiozlx" label="销帐类型"></v-text-field>
                  </v-col>
                   <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.touzbz" label="透支标志"></v-text-field>
                  </v-col>
                </v-row>
                 <v-row>
                  <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.jixiyf" label="计息与否"></v-text-field>
                  </v-col>
                  <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.lilvbh" label="利率编号"></v-text-field>
                  </v-col>
                   <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.jsclbz" label="入帐标志"></v-text-field>
                  </v-col>
                </v-row>
                 <v-row>
                  <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.fenlsy" label="分理处适用"></v-text-field>
                  </v-col>
                  <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.zhihsy" label="支行适用"></v-text-field>
                  </v-col>
                   <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.fenhsy" label="分行适用"></v-text-field>
                  </v-col>
                </v-row>
                 <v-row>
                  <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.znghsy" label="总行适用"></v-text-field>
                  </v-col>
                  <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.zcywdh" label="支出业务代号"></v-text-field>
                  </v-col>
                   <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.zczhxh" label="支出帐号序号"></v-text-field>
                  </v-col>
                </v-row>
                 <v-row>
                  <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.srywdh" label="收入业务代号"></v-text-field>
                  </v-col>
                  <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.srzhxh" label="收入帐号序号"></v-text-field>
                  </v-col>
                   <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.zddybz" label="对帐单打印标志"></v-text-field>
                  </v-col>
                </v-row>
                 <v-row>
                  <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.xjjybz" label="现金控制标志"></v-text-field>
                  </v-col>
                  <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.sfeikz" label="收费控制标志"></v-text-field>
                  </v-col>
                   <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.qdkzbz" label="渠道控制标志"></v-text-field>
                  </v-col>
                </v-row>
                 <v-row>
                  <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.rykzbz" label="冗余控制标志"></v-text-field>
                  </v-col>
                  <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.qngsfs" label="清算方式"></v-text-field>
                  </v-col>
                   <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.kfjzbz" label="可否记帐"></v-text-field>
                  </v-col>
                </v-row>
                 <v-row>
                  <v-col cols="12" sm="6" md="4">
                    <v-text-field  outlined dense v-model="business.dfywdh" label="对方业务代号"></v-text-field>
                  </v-col>
             
                </v-row>
              
            
              </v-container>
      </v-card-text>
      <v-card-actions>
        <v-spacer></v-spacer>
         <v-btn color="blue darken-1" text @click="close">关闭</v-btn>
      </v-card-actions>
    </v-card>
  </v-dialog>



  </v-card-text>
</v-card>
  
</template>

<script>
export default {
  data: () => ({
    dialog:false,
    search:'',
    business:{},
    headers: [
      {
        text: "核心一级科目号",
        align: "start",
        value: "level1Subject",
        width:200
      },
      { text: "科目名称", value: "level1SubjectInfo", width:200, filterable: false, },
       { text: "核心二级科目号", value: "level2Subject" , width:200},
        { text: "科目名称", value: "level2SubjectInfo" , width:200 ,filterable: false,},
         { text: "核心业务代码", value: "businessCode" , width:200},
          { text: "总账科目号", value: "glSubject" , width:200},
           { text: "总账科目名称", value: "glSubjectInfo" , width:300},
           
    ],
    desserts: [],
    
  }),

  computed: {
    
  },

  watch: {
  
  },

  created() {
    this.initialize();
   
  },

  methods: {
    initialize() {
     this.axios
        .get("/subject/list")
        .then(response => {
          this.desserts = response.data.data;
        })
        .catch(response => {
          console.log(response.data.message);
        });
    },
    businessInfo(item){
      this.dialog = true;
      this.axios
        .get("/businessCode/"+item.businessCode)
        .then(response => {
          this.business = response.data.data;
          console.log(this.business)
        })
        .catch(response => {
          console.log(response.data.message);
        });
    },
      close(){
      this.dialog = false;
    }
    },
    

  
};
</script>